Skip to content

Fix SSSOM structural mapping column names for sssom-py compatibility#144

Merged
realmarcin merged 3 commits intomainfrom
fix/sssom-empty-fallback
Apr 25, 2026
Merged

Fix SSSOM structural mapping column names for sssom-py compatibility#144
realmarcin merged 3 commits intomainfrom
fix/sssom-empty-fallback

Conversation

@justaddcoffee
Copy link
Copy Markdown
Collaborator

Summary

  • Renamed subject_typed4d_subject_range and object_typerocrate_value_type in the structural mapping generator and regenerated the TSV
  • Added a fallback in SSSOMIntegration when sssom-py returns 0 rows after silent drops

Context

subject_type and object_type are reserved SSSOM columns expecting EntityTypeEnum values (owl class, rdf property, etc.). The structural mapping was using these columns to store LinkML range names and Python types instead, which caused sssom-py to silently reject all 149 rows. This resulted in the test_load_structural_mapping CI failure.

The column data is preserved under non-reserved names. No mapping content was changed.

Test plan

  • sssom-py parses all 149 rows from the regenerated TSV
  • All 36 SSSOM tests pass
  • test_load_structural_mapping passes with sssom-py installed

🤖 Generated with Claude Code

Rename subject_type → d4d_subject_range and object_type →
rocrate_value_type to avoid colliding with reserved SSSOM columns
that expect EntityTypeEnum values. Add fallback in SSSOMIntegration
when sssom-py silently drops rows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the structural SSSOM mapping output to avoid reserved SSSOM column names (subject_type, object_type) so sssom-py no longer silently drops all rows, and adds a safety fallback to the custom reader when sssom-py yields an empty mapping set.

Changes:

  • Renamed structural mapping extension columns to d4d_subject_range and rocrate_value_type and updated the generator output accordingly.
  • Regenerated data/mappings/d4d_rocrate_structural_mapping.sssom.tsv with the new header.
  • Added a fallback path in SSSOMIntegration when sssom-py parses to 0 mappings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/fairscape_integration/utils/sssom_integration.py Adds “0 rows” detection and fallback to the custom TSV reader when sssom-py silently drops all mappings.
src/alignment/generate_structural_mapping.py Renames non-standard structural columns to non-reserved names for sssom-py compatibility.
data/mappings/d4d_rocrate_structural_mapping.sssom.tsv Updates TSV header (and regenerated content) to match the new column names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fairscape_integration/utils/sssom_integration.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fairscape_integration/utils/sssom_integration.py
realmarcin and others added 2 commits April 24, 2026 17:23
…l getter

- Emit RuntimeWarning when sssom-py returns 0 rows so the silent fallback
  to the custom reader is visible even when verbose=False
- Add SSSOMIntegration.get_active_implementation() instance method that
  reflects per-instance state (self.use_standard), so callers can tell
  which reader an instance is actually using after a runtime fallback
- Clarify get_implementation() docstring: it reports the default selection
  based on package availability, not per-instance state

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The empty-mappings fallback from this PR's first commit (2624ee2) was also
merged into main via PR #143, leaving only the Copilot-review follow-up
(warnings.warn + get_active_implementation) as unique to this branch.
Conflict resolved by keeping the warnings.warn block alongside the
already-on-main fallback logic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@realmarcin realmarcin merged commit d0938de into main Apr 25, 2026
3 checks passed
@realmarcin realmarcin deleted the fix/sssom-empty-fallback branch April 25, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants